package com.lfy.kcat.content.vod.config;

import com.lfy.kcat.content.vod.properties.VodProperties;
import com.qcloud.vod.VodUploadClient;
import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.vod.v20180717.VodClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author leifengyang
 * @version 1.0
 * @date 2025/9/8 14:05
 * @description:
 */
@Configuration
public class VodConfig {
    @Autowired
    VodProperties vodProperties;

    @Bean //专业负责上传功能
    public VodUploadClient vodUploadClient(){
        return new VodUploadClient(vodProperties.getSecretId(),
            vodProperties.getSecretKey());
    }


    @Bean //对媒资平台的其他增删改查
    public VodClient vodClient(){
        Credential credential = new Credential(vodProperties.getSecretId(),
            vodProperties.getSecretKey());
        return new VodClient(credential,vodProperties.getRegion());
    }
}
